<template>
    <ul class="todo-list">
      <!-- completed: 完成的类名 -->
      <li :class="{completed:obj.isDone}" v-for="(obj,index) in list" :key="obj.id">
        <div class="view">
          <input class="toggle" type="checkbox" v-model='obj.isDone'/>
          <label>{{obj.name}}</label>
          <button class="destroy" @click="delbtn(index)"></button>
        </div>
      </li>
    </ul>
    
  </template>
  
  <script>
  export default {
    props:["list"],
    methods:{
        delbtn(ind){
            this.$emit('del',ind)
        }
    }
  }
  </script>